This invention relates to techniques for producing a mirrored copy of a disk drive or other storage device.
In many computer systems, a level of fault tolerance is provided by storing identical data on each of multiple storage devices. Storage devices having identical data are referred to as mirrored devices and are said to belong to a mirror set. If one mirrored device in a mirror set fails or otherwise becomes inaccessible, the other mirrored device or devices in the mirror set continue to provide access to the data.
To maintain identical data on each device in a mirror set, each device must receive and process every request to store data on the mirror set (i.e., every write request). A device in a mirror set will diverge from other devices in the mirror set if the device is unable to process such write requests. When members of a mirror set become divergent, a mirror set copy may be performed to copy data from one mirrored device to another mirrored device. In one approach to maintaining a mirror set copy, the computer system is shut down and all data are copied from one mirrored device to the other mirrored device.
In one general aspect, a mirrored copy of a first storage device is maintained at a second storage device in a computer system. The first storage device includes an associated controller, and the second storage device includes an associated controller, volatile storage, and non-volatile storage. Write requests received at the storage devices are processed. A commit-synchronization message is sent to the second storage device along with information designating a write request, and the controller of the second storage device, after receiving the commit-synchronization message, confirms that data associated with the designated write request have been written to the non-volatile storage of the second storage device.
Implementations may include one or more of the following features. For example, the controller of the second storage device may confirm that data associated with all write requests that preceded the designated write request have been written to the non-volatile storage of the second storage device. Alternatively, the controller of the second storage device may process the designated write request and may confirm that data associated with the designated write request and preceding write requests have been written to the non-volatile storage of the second storage device. The controller of the second storage device may confirm a successful cache flush of the volatile storage of the second storage device.
Information sent with the commit-synchronization message may be a reference label identifying a write request processed or to be processed by the first storage device. The reference label may be assigned sequentially relative to reference labels assigned to other write requests. All write requests received at the second storage device may be sequentially processed prior to processing the write request identified by the reference label in the commit-synchronization message.
The identified regions of storage affected by write requests may be accumulated in, for example, a first bit map. After sending the commit-synchronization message, newly-identified regions of storage may be accumulated in a second bit map. After the controller of the second storage device confirms that data in the processed write requests have been written to non-volatile storage of the second storage device, a status message may be sent to the first storage device to indicate that the write data were successfully written to the non-volatile storage. After receipt of the status message indicating that the write data were successfully written, the first bit map may be deleted and the second bit map may be designated as the first bit map.
After a period when the second storage device was unavailable, the contents of the first bit map may be copied to a recovery bit map that then is used to identify the regions of storage of the first storage device to be copied from the first storage device to the second storage device. The identified regions of storage of the first storage device may be copied to the second storage device; and newly-received write requests may be accumulated at the second storage device in a third bit map.
The second storage device may perform one or more of the features and functions as described above with respect to the first storage device, and the first storage device may perform one or more of the features and functions as described above with respect to the second storage device.
In another general aspect, maintaining a mirrored copy of a first storage device at a second storage device in a computer system includes receiving write requests at a first storage device that includes an associated controller, volatile storage, and non-volatile storage; processing the write requests received at the first storage device; receiving write requests at a second storage device that includes an associated controller, volatile storage, and non-volatile storage; and processing the write requests received at the second storage device. After determining that the second storage device is about to enter a period in which the second storage device will be unable to process write requests, the controller of the first storage device sends a commit-synchronization message to the second storage device along with information designating a write request, and the controller of the second storage device, after receiving the commit-synchronization message, confirms that data associated with the designated write request have been written to the non-volatile storage of the second storage device. After sending the commit-synchronization message, the controller of the first storage device accumulates regions of storage affected by new write requests in a bit map. Once the second storage device is able to process write requests again, the controller of the first storage device uses the bit map to identify the regions of storage of the first storage device to be copied from the first storage device to the second storage device and copies the contents of the identified regions of the first storage device to the second storage device.
Implementations of the techniques discussed above may include a method or process, an apparatus or system, or computer software on a computer-accessible medium.
The details of one or more of the implementations are set forth in the accompanying drawings and description below. Other features and advantages will be apparent from the descriptions and drawings, and from the claims.